<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'order-process', //页面标示
    'pagename' => '订单处理', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
	  'footerjs'=>array('content/fuelux/fuelux','content/combodate/moment.min','content/combodate/combodate'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
  <section id="content">
    <!-- main padder --> 
    <section class="main padder"> 
    <div class="clearfix"> 
     <h4><i class="fa fa-edit"></i>订单处理</h4> 
    </div> 
    <div class="row"> 
     <div class="col-sm-12"> 
      <section class="panel"> 
       <div class="panel-body">
    <?php 
    	switch ($info['order_state']) {
    		case '20'://配送处理
    ?> 
        <form class="form-horizontal" method="post" id="processForm"> 
         <div class="form-group"> 
          <label class="col-sm-1 control-label">物流配送</label> 
          <div class="col-sm-5"> 
			<select name="shipping_express_id" id="shipping_express_id">
				<?php foreach ($express as $key => $value) { ?>
				<option value="<?php echo $value['id']; ?>"><?php echo $value['e_name']; ?></option>
				<?php } ?>
			</select>
          </div> 
         </div> 
         <div class="form-group"> 
          <label class="col-sm-1 control-label">物流单号</label> 
          <div class="col-sm-5"> 
           <input type="type" name="shipping_code" id="shipping_code" placeholder="" data-required="true" class="bg-focus form-control" />
           <div class="line line-dashed m-t-large"></div> 
          </div> 
         </div> 
        
         <div class="form-group"> 
          <div class="col-sm-9 col-lg-offset-3"> 
           <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
           <input type="hidden" name="order_state" value="<?php echo $info['order_state']; ?>">
		   <div class="col-sm-1"><button type="submit" id="sub-ok" data-loading-text="正在提交..." class="btn btn-primary">保存</button></div>
           <button type="button" class="btn btn-white col-md-offset-1" onclick="history.go(-1);">取消</button> 
          </div> 
		  
         </div> 
        </form> 
    <?php			
    			break;
    		case '60'://退货处理
    ?>
    
    <?php
    			break;
    		default:
    			# code...
    			break;
    	}
    ?>

       </div> 
      </section>
     </div> 
    </div> 
   </section> 
    <!--/ main padder -->  
  </section> 
  <!--/ content --> 
<!--主体 结束-->
<script>
$(function(){
	$('#processForm').submit(function(){
		if (!$('#shipping_code').val()){
			Msg.error('请输入订单号');
			resetSubmit("#sub-ok",'提交');
			return false;
		}
		Msg.loading();
		  $.post('<?php echo U('order/process');?>',$(this).serialize(),function(result){
			  Msg.hide();
			  resetSubmit("#sub-ok",'提交');
			  if (result.status==1){
				Msg.ok(result.info);  
			}else{
				Msg.error(result.info);
			}
		  },'json');
		  return false;
	})
})
</script>
<?php
include getTpl('footer', 'public');
?>